//Thank you to hacobi1102 - ladykillah
//Do not remove copyright - it is public version
function hacobi_flash(link)
{
	var link = link;
	var hacobi1 = link.indexOf("www.youtube.com");
	var hacobi2 = link.indexOf("www.nhaccuatui.com");
	var hacobi3 = link.indexOf("static.mp3.zing.vn");
	//var hacobi4 = link.lastIndexOf(".swf");
	//Youtube pro
	if(hacobi1>0||hacobi2>0||hacobi3>0){
	if(hacobi1>0){
		linkid=link.substr(31,11);
			document.write ("<object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/"+linkid+"?fs=1&amp;hl=en_US&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/"+linkid+"?fs=1&amp;hl=en_US&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='600' height='480'></embed></object>");
			document.write ("<br><img src='http://img.youtube.com/vi/"+linkid+"/1.jpg' border='0' alt='Xem Tru?c'>  <img src='http://img.youtube.com/vi/"+linkid+"/2.jpg' border='0' alt='Xem Tru?c'>   <img src='http://img.youtube.com/vi/"+linkid+"/3.jpg' border='0' alt='Xem Tru?c'>");
	}
	//NHAC CUA TUI
	if(hacobi2>0){
		var kitu;
		kitu=link.substr(26,1);
		if(kitu=="m"){
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='300' height='50'>");
		}
		else if (kitu=="l"){
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='300' height='400'>");
		}
		else{
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='300' height='61'>");
		}
	}

	//MP3 ZING
	if(hacobi3>0){
		var kitu2=link.substr(48,6);
		var kitu3=link.substr(48,8);
		var kitu4=link.substr(32,1);
		//Mp3 Zing ver 3
		var zingp1=link.substr(47,6);
		var zingp2=link.substr(50,8);

		if(kitu2=="player"||zingp1=="player"){
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='430' height='80'></embed>");
			}
		else if(kitu3=="playlist"||zingp2=="playlist"){
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='300' height='300'></embed>");
			}
		else if(kitu4=="d"){
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='480' height='61'></embed>");
			}
	}
	}
	//FLASH
	else{
			document.write ("<embed src="+link+" quality='high' wmode='transparent' type='application/x-shockwave-flash' width='640' height='480'></embed>");
			}
}